﻿using System;

namespace ListAndHashTest
{
    internal class Program
    {
        static void Main(string[] args)
        {

            ListDemo listDemo = new ListDemo();
            DictionaryDemo dictionaryDemo= new DictionaryDemo();

            int[] ids = new int[] { 4000354, 4777756, 3777856, 2777956, 3000354, 4800354, 4877756, 3877756, 4977756, 3800354 };

            DateTime dt = DateTime.Now;
            for (int ind = 0; ind < 10; ind++)
                for (int i = 0; i < ids.Length; i++) {
                    listDemo.getFor(ids[i]);
                }
            TimeSpan ts = DateTime.Now - dt;
            Console.WriteLine("listDemo.getFor() 取数据所用时间:{0}", ts.TotalMilliseconds);

            dt = DateTime.Now;
            for (int ind = 0; ind < 10; ind++)
                for (int i = 0; i < ids.Length; i++)
                {
                    listDemo.getLambad(ids[i]);
                }
            ts = DateTime.Now - dt;
            Console.WriteLine("listDemo.getLambad() 取数据所用时间:{0}", ts.TotalMilliseconds);

            dt = DateTime.Now;
            for(int ind=0; ind < 100000; ind++)
                for (int i = 0; i < ids.Length; i++)
                {
                    dictionaryDemo.GetStudent(ids[i]);
                }
            ts = DateTime.Now - dt;
            Console.WriteLine("dictionaryDemo.GetStudent() 取数据所用时间:{0}", ts.TotalMilliseconds);


            Console.WriteLine("Hello, World!");
        }
    }
}